from django.contrib import admin

from .models import Choice, Question


class ChoiceInline(admin.TabularInline):
    model = Choice
    extra = 3
    
class QuestionAdmin(admin.ModelAdmin):
    
    fieldsets = [
        ("投票主题", {"fields": ["question_text"]}),
        ("发布时间", {"fields": ["pub_date"], }),
    ]
    inlines = [ChoiceInline]


admin.site.register(Question,QuestionAdmin)
